package com.pengchuang.ACS.face.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pengchuang.ACS.common.utils.PageUtils;
import com.pengchuang.ACS.common.utils.Query;

import com.pengchuang.ACS.face.dao.CellDao;
import com.pengchuang.ACS.face.entity.CellEntity;
import com.pengchuang.ACS.face.service.CellService;


@Service("cellService")
public class CellServiceImpl extends ServiceImpl<CellDao, CellEntity> implements CellService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<CellEntity> cellEntityQueryWrapper = new QueryWrapper<>();
        Object keyWord = params.get("keyWord");
        if (keyWord != null) {
            cellEntityQueryWrapper.like("cell_name", keyWord);
        }
        IPage<CellEntity> page = this.page(
                new Query<CellEntity>().getPage(params),
                cellEntityQueryWrapper
        );

        return new PageUtils(page);
    }

}